<template>
</template>

<script>
	export default {
		name: "mixin",
		data() {
			return {
				// 设置默认分享参数
				share: {
					title: 'ALAPI',
					path: '/pages/tabBar/home/home',
					imageUrl: '',
					desc: '',
					content: ''
				}
			};
		},
		// 分享触发的回调
		onShareAppMessage(options) {
			return {
				title: this.share.title,
				path: this.share.path,
				imageUrl: this.share.imageUrl,
				desc: this.share.desc,
				content: this.share.content,
				success(res) {
					uni.showToast({
						title: '分享成功'
					})
				},
				fail(res) {
					uni.showToast({
						title: '分享失败',
						icon: 'none'
					})
				}
			}
		},
		onShareTimeline: function(res) {
			return {
				title: this.share.title,
				path: this.share.path,
				imageUrl: this.share.imageUrl,
				desc: this.share.desc,
				content: this.share.content,
				success(res) {
					uni.showToast({
						title: '分享成功'
					})
				},
				fail(res) {
					uni.showToast({
						title: '分享失败',
						icon: 'none'
					})
				}
			}
		},

	}
</script>


<style>
</style>